const http=require("https");
const url="https://www.baidu.com/"
http.get(url, (res) => {
    // let data = url.parse(req.url, true).query;
    // console.log('statusCode: ', res.statusCode);
    // console.log('headers: ', res.headers);
    let data="";
    res.on("data", (chunk) => {
        data += chunk.toString();
    })
    res.on("end", () => {
        console.log(data);
    })
}).on('error', (e) => {
    console.error(e);
});

